//
//  Common.swift
//  MySina
//
//  Created by mac on 2017/1/16.
//  Copyright © 2017年 xinyuan. All rights reserved.
//

import UIKit

//新浪微博OAuth授权
let APPKEY = "2507318676"
let APPSECRET = "7a83150cb5ec596dbe2a64ebd485d070"
let REDIRECT_URI = "http://www.baidu.com"

//设置全局变量 屏幕宽度和高度
let SCREENW = UIScreen.main.bounds.width
let SCREENH = UIScreen.main.bounds.height

//设置全局颜色
let OrangeColor = UIColor.orange

//设置颜色的方法
func RGB(r: Float, g: Float, b: Float, alpha: Float = 1) -> UIColor {
    return UIColor(colorLiteralRed: r/Float(255), green: g/Float(255), blue: b/Float(255), alpha: alpha)
}

//设置随机颜色的方法
func RandomColor() -> UIColor {
    let r = Float(arc4random()%256)
    let g = Float(arc4random()%256)
    let b = Float(arc4random()%256)
    return RGB(r: r, g: g, b: b)
}








